package Custom;

import java.awt.Color;
import java.awt.Point;
import java.util.TreeSet;

import javax.swing.JLabel;
import javax.swing.JPanel;

import Controller.accountMouseListener;
import Model.Account;
import Model.Accounts;
	
@SuppressWarnings("serial")
public class AccountLayout extends JPanel{

	private String accountType;
	private String accountNumber;
	private JLabel labelBalance = new JLabel("Saldo");
	private JLabel labelAccountNumber = new JLabel("Rekening_nummer");
	private JLabel labelAccountName = new JLabel("Rekening_naam");
	
	@SuppressWarnings("unused")
	private Color background = new Color(105, 105, 105);
	private int marginLeft =  100;
	private int marginTop =  370;
	 public  AccountLayout(Account Account, int marginLeft, int marginTop){
		 	Account R = Account;

		 	accountType = R.getType();
		 	String balance = "€ " + R.getBalance().toString();
		 	accountNumber = R.getAccountNumber().substring(9);

			setBackground(Color.gray);
			
			setLocation(marginLeft, marginTop);
			setSize(120, 70);
			
			labelAccountName.setText(accountType);
			labelAccountNumber.setText(accountNumber);
			labelBalance.setText(balance);
			
			add(labelAccountName);
			add(labelAccountNumber);
			add(labelBalance);
		
		addMouseListener(new accountMouseListener(this) );
		
		
	 }
	
	 	public int getMarginLeft() {
			marginLeft = (marginLeft + 40);
			if(marginLeft >= 200){
				setMarginTop(marginTop + 100);
				setMarginLeft(100);
			}
			return marginLeft;
		}

		public void setMarginLeft(int marginLeft) {
			this.marginLeft = marginLeft;
		}
		
		public int getMarginTop() {
			return marginTop;
		}

		public void setMarginTop(int marginTop) {
			this.marginTop = marginTop;
		}
	
	
} 
